<template>
  <div class="admin-web-experience">
    <div class="clearfix">
      <el-button
        class="float-right"
        size="mini"
        type="primary"
        @click="addBtnClick">
        <i class="el-icon-plus"/>
      </el-button>
    </div>
    <br>
    <!--工作数据数组-->
    <w-item
      v-for="(v, k) in dataArr"
      :item="v"
      :key="k"
      @reload="getAllWorks"/>
    <w-pop
      ref="POP"
      @reload="getAllWorks"/>
  </div>
</template>

<script>
// 工作经历
import WPop from './pop'
import WItem from './item'
import WorkModel from '@/models/web/WorkModel'
export default {
  name: 'AdminWebExperience',
  components: {
    WItem,
    WPop
  },
  data() {
    return {
      /**
       * 数据数组
       */
      dataArr: []
    }
  },
  computed: {
  },
  mounted() {
    this.getAllWorks()
  },
  methods: {
    /**
     * 添加按钮点击
     */
    addBtnClick() {
      this.$refs['POP'].show()
    },
    /**
     * 获取所有数据
     */
    getAllWorks() {
      WorkModel.loadAllModels().then((dara) => {
        this.dataArr = dara
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
